using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BGMMangger : MonoBehaviour
{
    public static BGMMangger Instance
    {
        get
        {
            if(instance == null)
            {
                instance = FindObjectOfType<BGMMangger>();
            }
            if(instance == null)
            {
                GameObject go = new GameObject("BGMObject");
                instance=go.AddComponent<BGMMangger>();
                DontDestroyOnLoad(go);
            }
            return instance;
        }
        
    }
    private static BGMMangger instance;
    private void Awake()
    {
        if (Instance != this) Destroy(this.gameObject);
        DontDestroyOnLoad(this.gameObject);
    }
}
